/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.C270;
import queenb.net.entitybean.C270;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class C270Store extends C270 {

    public List<C270> ccurpks_listoftabc270(int pnFH000, int pnFH200, int pnPN270, String pvLOGIN) {
        try {
            DataStatement data = new DataStatement(PackageContants.ccurpks_listoftabc270, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.CHAR, pnPN270),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(data, C270.class);
        } catch (SQLException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }

    public int stdc_tools_inserttabc270(int pnFC575, int pnFC350,
            String pvCV271, String pvCV272, int pnCN273,
            int pnCN274, Date pdCD275, Date pdCD276, String pvLOGIN) {
        DataStatement dataStetament = new DataStatement(PackageContants.stdc_tools_inserttabc270, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFC575),
                    new Param(OracleTypes.INTEGER, pnFC350),
                    new Param(OracleTypes.CHAR, pvCV271),
                    new Param(OracleTypes.CHAR, pvCV272),
                    new Param(OracleTypes.INTEGER, pnCN273),
                    new Param(OracleTypes.INTEGER, pnCN274),
                    new Param(OracleTypes.DATE, pnCN274),
                    new Param(OracleTypes.DATE, pnCN274),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.update(dataStetament, C270.class);
        } catch (SQLException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }
    }

    public int stdc_tools_stornotabc270(int pnPC270, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_stornotabc270, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPC270),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, C270.class);
        } catch (SQLException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    public int stdc_tools_updatetabc270(int pnPC270, int pnCN274, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_updatetabc270, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPC270),
                        new Param(OracleTypes.INTEGER, pnCN274),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, C270.class);
        } catch (SQLException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }

    public List<C270> findAllC270ForCombo(int pnFH000, int pnFH200, int pnPC270, String pvKV303, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdc_tools_stornotabc270, OracleTypes.CURSOR, new Param[]{
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnPC270),
                        new Param(OracleTypes.CHAR, pvKV303),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.find(dataStatement, C270.class);
        } catch (SQLException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(C270Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
}
